Exercise: Consuming SOAP based web services

Credit to Anders Bøjesson

Idea:Comsuming existing web services

Background: w3schools -  Web Services Tutorial |  Introuction to WSDL |  SOAP Introduction
                          msdn -

The web site http://www.webservicex.net/ws/default.aspx introduces a lot of relatively simple web services ready for consumption.

In this exercise you will make client applications for some of these web services.

Some of the services work - others don't.
Try the services in your browser before you start making a client application.

Exercise:

For each service your want to try

  1. Try the service in the browser
  2. Make a client application, preferable a console application
  3. Add a service reference to project
    www.webservices.net/ws/.....?WSDL
  4. Make a simple client to try out the service
    Some of the methods will return a string containing a loooong XML text, others will return a simple result.

Some services to try

  1. Currency convertor
  2. Simple statistics
  3. Country details
  4. Temperature unit convertor
  5. Global weather
  6. Bible quotes
  7. Periodic table
  8. WHOIS
  9. Extra KlimaData web services (wsKlima) delivered from Norway
  10. others from http://www.webservicex.net/ws/default.aspx or elsewhere

Extra: Sniff web service comunication with Fiddler or Wireshark

Before you run your program - start either Fiddler or Wireshark

Investigate the http comunication after running your program.

Focus on http, xml and the xml encoded envelope.

Extra: Parse XML output

Some of the service methods return a long XML string.

Use the class XmlDocument to parse the XML string to get access to data inside the string.

Extra: GUI

Make a GUI include one (or more ...) of the web services you already tried.